<?php
/* 
require_once 'core.php';


$nm = cf\query2var(
	'SELECT name FROM cf_admin_categories WHERE id=:id',
	array(	'id' => cf\param::get('id')	)
);

$smarty->assign('nm', $nm);
show('category',$nm,array(array('',$nm)));
 */

require_once 'core.php';
require_once cf\Config::path.'api/admin.php';

//$view = cf\api\admin\getCategories();
$view = cf\api\admin\getView(cf\param::get('id'));
$smarty->assign('view', $view);
$smarty->assign('fk', cf\param::exist('fk') ? cf\param::asInt('fk') : false);


$name = '';
if (cf\param::exist('tid') && cf\param::exist('fk')) {
	$name = cf\api\admin\getNameByKey(cf\param::get('tid'), cf\param::get('fk'));
}

show(
	'category',
	$view['name'].($name ? ": $name" : ''), 
	array(array($view['url'].'?vid='.$view['id'],$view['name']))
);

?>